package m07;

import java.io.Serializable;

/**
 * This class controls the Player.
 * 
 * @author Jessica Roberts
 * @version 1.2 22 October 2012
 */

public class Player implements Serializable {
	private static final long serialVersionUID = 6481041288409978723L;
	private String name;
	private int pilot;
	private int fighter;
	private int trader;
	private int engineer;
	private int money;
	private Ship playerShip;

	/**
	 * This constructor takes in the parameters for the Player and sets 
	 * them equal to the instantiated variables.
	 *
	 * @param name The name of the Player
	 * @param pilot The number of pilot points
	 * @param fighter The number of fighter points
	 * @param trader The number of trader points
	 * @param engineer The number of engineer points
	 */
	public Player (String name, int pilot, int fighter, int trader, int engineer)
	{
		this.name = name;
		this.pilot = pilot;
		this.fighter = fighter;
		this.engineer = engineer;
		this.trader=trader;
		money = 1000;
		playerShip = new Ship("flea",10);
	}
	
	/**
	 * a getter for the name
	 * @return the name
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * a getter for the pilot points
	 * @return the amt of pilot points
	 */
	public int getPilot()
	{
		return pilot;
	}

	/**
	 * a getter for the fighter points
	 * @return the amt of fighter points
	 */
	public int getFighter()
	{
		return fighter;
	}

	/**
	 * a getter for the trader points
	 * @return the amt of trader points
	 */
	public int getTrader()
	{
		return trader;
	}

	/**
	 * a setter for the engineer points
	 * @param num the num to set the points to
	 */
	public void setEngineer(int num)
	{
		engineer = num;
	}
	
	/**
	 * a setter for the pilot points
	 * @param num the num to set the points to
	 */
	public void setPilot(int num)
	{
		pilot = num;
	}
	
	/**
	 * a setter for the fighter points
	 * @param num the num to set the points to
	 */
	public void setFighter(int num)
	{
		fighter = num;
	}

	/**
	 * a setter for the trader points
	 * @param num the num to set the points to
	 */
	public void setTrader(int num)
	{
		trader = num;
	}

	/**
	 * a getter for the engineer points
	 * @return the num of engineer points
	 */
	public int getEngineer()
	{
		return engineer;
	}

	/**
	 * a getter for the money
	 * @return the money the player has
	 */
	public int getMoney()
	{
		return money;
	}

	/**
	 * a setter for the money
	 * @param m how much money the player should have
	 */
	public void setMoney(int m)
	{
		money = m;
	}
	
	/**
	 * a getter for the ship that the player owns.
	 * @return
	 */
	public Ship getShip(){
		return playerShip;
	}
	
	public void setShip(Ship ship){
		playerShip = ship;
	}
}
